export const isOpshields = () => {
    return window.navigator.userAgent.includes('opshields');
}

export const opshieldsVersion = () => {
    if (isOpshields()) {
        return window.navigator.userAgent.split("opshields/")[1].split(" ")[0];
    }
    return null;
}

/**
* Move an array item to a different position. Returns a new array with the item moved to the new position.
*/
export function arrayMove(array: any[], from: number, to: number) {
    const newArray = array.slice();
    newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
    return newArray;
}
